<?php

class Default_Widgets_Currency_Widget extends Nimblecms_Widget 
{	
	protected function _prepareShow() 
	{
		$urlXml = 'http://www.cbr.ru/scripts/XML_daily.asp';
		
		$xml = file_get_contents($urlXml);
		
		$xml = simplexml_load_string($xml);
		
		$this->_view->dollar = substr((string)$xml->Valute[9]->Value, 0, -2);
		$this->_view->euro = substr((string)$xml->Valute[10]->Value, 0, -2);
	}
}
